<?php
class Aplication_Form_LoginForm extends Zend_Form
{
   public function init()
    {
       $this->setAction ( '' )
            ->setMethod ( 'post' );
      
      // Create and configure username element:
      $username = $this->createElement ( 'text', 'username' );
      $username->addValidator ( 'alnum' )
            ->addValidator ( 'regex', false, array ('/^[a-z]+/' ) )
            ->addValidator ( 'stringLength', false, array (6, 20 ) )
            ->setRequired ( true )
            ->addFilter ( 'StringToLower' );
      
      // Create and configure password element:
      $password = $this->createElement ( 'password', 'password' );
      $password->addValidator ( 'StringLength', false, array (6 ) )
             ->setRequired ( true );
      
      $submit = $this->createElement('submit','login',array ('label' => 'Login' ));
      // Add elements to form:
      $this->addElement ( $username )
           ->addElement ( $password )           
           ->addElement($submit);
    }
    /**
     *  <form action="page.php" method="post">
     *      <input type="text" name="blah" />
     *  </form>
     */   
}